<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="${#request.getContextPath() + '/'}"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
    <!-- Reset Stylesheet -->
    <link rel="stylesheet" href="resources/css/reset.css" type="text/css"
          media="screen" />
    <!-- Main Stylesheet -->
    <link rel="stylesheet" href="resources/css/style.css" type="text/css"
          media="screen" />
    <link rel="stylesheet" href="resources/css/invalid.css" type="text/css"
          media="screen" />



    <!--                       Javascripts                       -->
    <!-- TODO 如果需要使用日期控件，jquery版本最好调成1.7以上 jQuery -->
    <script type="text/javascript"
            src="resources/scripts/jquery-1.8.3.min.js"></script>
    <!-- jQuery Configuration -->
   <!-- <script type="text/javascript"
            src="resources/scripts/simpla.jquery.configuration.js"></script>-->

    <!-- 引入My97Date的日期控件 -->
   <!-- <link rel="stylesheet" href="resources/widget/My97DatePicker/skin/default/datepicker.css"  type="text/css"
          media="screen"/>-->
    <script src="resources/widget/My97DatePicker/WdatePicker.js"></script>
  <!--  <script src="resources/widget/My97DatePicker/calendar.js"></script>
    <script src="resources/widget/My97DatePicker/lang/zh-cn.js"></script>-->

    <style>
        .seckill{
            display: none;
        }
    </style>

    <script>
        /**
         * 商品类型的切换操作
         * @param flag
         */
        function switchType(flag){
            if (flag == 1){
                //选择了秒杀商品
                $(".seckill").show();
            } else {
                //选择了普通商品
                $(".seckill").hide();
            }
        }
    </script>

</head>
<body>
<div id="main-content">
    <div class="content-box">
        <div class="content-box-content">
            <div class="tab-content default-tab" id="tab2">
                <!-- 如果需要表单上传图片，那么表单必须设置enctype="multipart/form-data" 并且必须为post请求 -->
                <form action="/backseckill/insert" method="post" enctype="multipart/form-data">
                    <fieldset>
                        <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
                        <p>
                            <label>商品标题</label> <input
                                class="text-input small-input" type="text"
                                name="subject" />
                        </p>
                        <p>
                            <label>商品类型</label>
                            <input type="radio" name="type" value="0" checked onclick="switchType(0);"/> 普通商品<br />
                            <input type="radio" name="type" value="1" onclick="switchType(1);"/> 秒杀商品
                        </p>
                        <p class="seckill">
                            <label>秒杀开始时间</label> <input
                                class="text-input small-input" type="text" value="2000-01-01 00:00:00"
                                name="startTime" onClick="WdatePicker({startDate:'%y-%M-%d {%H+1}:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                        </p>
                        <p class="seckill">
                            <label>秒杀结束时间</label> <input
                                class="text-input small-input" type="text" value="2000-01-01 00:00:00"
                                name="endTime" onClick="WdatePicker({startDate:'%y-%M-%d {%H+2}:00:00', dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                        </p>
                        <p>
                            <label>商品图片</label> <input
                                class="text-input large-input" type="file"
                                name="file" />
                        </p>
                        <p>
                            <label>商品价格</label> <input
                                class="text-input small-input" type="text"
                                name="price" />
                        </p>
                        <p class="seckill">
                            <label>秒杀价格</label> <input
                                class="text-input small-input" type="text"
                                name="seckillPrice" />
                        </p>
                        <p>
                            <label>商品库存</label> <input
                                class="text-input small-input" type="text"
                                name="save" />
                        </p>
                        <p class="seckill">
                            <label>秒杀库存</label> <input
                                class="text-input small-input" type="text"
                                name="seckillSave" />
                        </p>

                        <p>
                            <label>商品秒杀</label>
                            <textarea class="text-input textarea wysiwyg"
                                      name="info" cols="79" rows="15"></textarea>
                        </p>
                        <p>
                            <input class="mybutton" type="submit" value="Submit" />
                        </p>
                    </fieldset>
                    <div class="clear"></div>
                    <!-- End .clear -->
                </form>
            </div>
            <!-- End #tab2 -->
        </div>
        <!-- End .content-box-content -->
    </div>
</div>
<!-- End #main-content -->
</body>
</html>